<?php
	include_once(ROOTPATH .'include'. DS .'initUser.php');
	include_once(ROOTPATH .'class'. DS .'favorites.class.php');
	include_once(ROOTPATH .'class'. DS .'comment.class.php');	
	include_once( ROOTPATH .'class'. DS .'star.class.php'); 
	include_once( ROOTPATH .'class'. DS .'honor.class.php'); 
	include_once( ROOTPATH .'class'. DS .'task.class.php'); 
	include_once( ROOTPATH .'class'. DS .'mediaFile.class.php');
	$task = new task ;
	$mediaFile = new mediaFile ;
	$idCode		= getQuery('id');
	$id			= getId('id');
	$showType	= getQuery('showType');
	$queryCode	= getQuery('query');
	
	$mediaFile -> checkStatus( $id );
	
	// task query
	$query			= $encrypt -> recode($queryCode);
	$query 			= explode(INVITE_SPLIT_STRING , $query );	//412|-_-|111@qqq.com|-_-|2010-06-30|-_-|20 
//	$selectionArea	= $query[3];	
	$task_id_code 		= (int)$query[0];
	$task_id			= (int)$query[0];
	$user_name			= $query[1];
	
	if( $user_name != ''  && $task_id != 0){
		$commentType = 'judge';
	}
	
	
	
	
	$honor		= new honor ;
	$star = new star ;
					
	$shows = $dbs -> select('SELECT * FROM `'. DB_PRE.'file` WHERE `id` = '. $id);
	$show = $shows[0];
	
	$allowTaskCreator = $task -> allowTaskCreator($show['id']);
	
	if(  $show['status'] != '1'  ){
		if(  in_array($user -> id() , $allowTaskCreator ) || $show['user_id'] == $user -> id() || $user -> powder() >= 9 )
			;
		else
			exit(infoPage('此页面背隐藏,您没有权限查看',urlRewrite(''),9999));
	}
	
	$isExist = true ;
	if( 0 == count($show))
		$isExist = false;
	
	
	$userInfo = $user -> getUser($show['user_id']);
	
	if( $isExist ){
		
		$hit = new hits();
		$hit -> add('media',$id);
	}
	
	
	
	$isMy = false;
	if( $show['user_id'] == $user -> id() )
		$isMy = true;
	
	$isISetStar = false;
	$lists = $dbs -> select('SELECT * FROM `'.DB_PRE.'star` WHERE `user_id` = '. $user -> id()  .' and `file_id` = '. $id .' limit 0 , 1 ');
	if( count($lists) > 0 ){
		$isISetStar = true ;
		unset($lists);
	}
	
	$isShowTop = true ;
	if( 'assess' == $showType )
		$isShowTop = false;
	
	$isShowTitileBar = true ;
	if( 'assess' == $showType )
		$isShowTitileBar = false ;
	
	$isShowNav = true ;
	if( 'iframe' == $showType || 'assess' == $showType )
		$isShowNav = false ;	
		
	
	$isShowBasicInfo = true ;
	if( 'assess' == $showType )
		$isShowBasicInfo = false;
	
	$isShowComments = true ;
	if( /*'simple' == $showType ||*/ !$isExist )
		$isShowComments = false;
	
	
	$isShowJudgeStar = false ;
	if( 'assess' == $showType )
		$isShowJudgeStar = true;
		
		
	
	$isShowFooter = true ;
	if( 'iframe' == $showType || 'assess' == $showType )
		$isShowFooter = false;

		
	
?>